Skip to content

Add MCP Resource trigger templates for JavaScript and TypeScript#4966

Merged
nturinski merged 2 commits intomicrosoft:mainfrom
swapnil-nagar:swapnil/mcpResourceTemplate
Apr 16, 2026
Merged

Add MCP Resource trigger templates for JavaScript and TypeScript#4966
nturinski merged 2 commits intomicrosoft:mainfrom
swapnil-nagar:swapnil/mcpResourceTemplate

Conversation

@swapnil-nagar
Copy link
Copy Markdown
Contributor

Description:

This PR adds new MCP Resource trigger templates for Node.js v4 projects and integrates them into template discovery/validation flow.

Changes:

  • Added MCP Resource templates for:
  • JavaScript: McpResourceTrigger-Javascript-4.x
  • TypeScript: McpResourceTrigger-TypeScript-4.x
  • Updated script template verification to include McpResourceTrigger.
  • Updated MCP trigger detection so mcpResourceTrigger is treated as an MCP trigger.
  • Updated backup template count expectations for JavaScript and TypeScript tests.

@swapnil-nagar swapnil-nagar requested a review from a team as a code owner April 8, 2026 20:24
Copilot AI review requested due to automatic review settings April 8, 2026 20:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds MCP Resource trigger templates for Node.js v4 (JavaScript/TypeScript) and wires them into the existing template verification and MCP-trigger detection logic.

Changes:

  • Add Node.js v4 backup templates for McpResourceTrigger (JavaScript + TypeScript).
  • Treat mcpResourceTrigger templates/bindings as MCP triggers in template parsing and function config detection.
  • Update script template verification list and adjust backup template count expectations in tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/templateCount.test.ts Updates expected template counts for JS/TS v4 when using Backup templates.
src/templates/script/parseScriptTemplatesV2.ts Extends MCP trigger detection to include mcpresourcetrigger ids.
src/templates/script/getScriptVerifiedTemplateIds.ts Adds McpResourceTrigger to the verified script template id allowlist.
src/funcConfig/function.ts Updates isMcpTrigger to recognize mcpResourceTrigger.
resources/backupTemplates/nodejs-4.x/templates/templates.json Adds backup templates for MCP Resource triggers (JS + TS).

}
},
{
"id": "McpResourceTrigger-Javascript-4.x",
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template id uses McpResourceTrigger-Javascript-4.x (lowercase s) whereas other Node v4 JavaScript templates in this file use the -JavaScript-4.x suffix (e.g., McpToolTrigger-JavaScript-4.x). Since template ids act as stable identifiers across providers/feeds, this inconsistency can lead to mismatches or duplicate templates if another source uses the canonical JavaScript id. Consider renaming the id to McpResourceTrigger-JavaScript-4.x to match the established pattern.

Suggested change
"id": "McpResourceTrigger-Javascript-4.x",
"id": "McpResourceTrigger-JavaScript-4.x",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other ids are JavaScript. I think we try to normalize all of the ids so that casing shouldn't matter, but you should still be consistent.

@nturinski nturinski merged commit 17f492a into microsoft:main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants